package com.gin.no_gay_alliance.manager;

import com.gin.nga.enums.FollowType;
import com.gin.nga.method.NukeApi;
import com.gin.nga.params.nuke.follow.FollowParam;
import com.gin.nga.response.body.BaseMessageBody;
import com.gin.nga.response.body.nuke.FollowStatusBody;
import com.gin.nga.response.body.nuke.FollowUserListBody;
import com.gin.no_gay_alliance.app.MyApplication;
import com.gin.no_gay_alliance.callback.Callback;
import com.gin.no_gay_alliance.callback.RequestCallback;

/**
 * 关注管理器
 *
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/9/13 15:49
 **/
public class FollowManager {
    /**
     * 关注用户
     *
     * @param userId   用户id
     * @param callback 回调
     */
    public void followUser(long userId, Callback<BaseMessageBody> callback) {
        NukeApi.follow(MyApplication.getClient(), new FollowParam(FollowType.FOLLOW_USER, userId)).async(new RequestCallback<>(callback));
    }

    /**
     * 取关用户
     *
     * @param userId   用户id
     * @param callback 回调
     */
    public void unfollowUser(long userId, Callback<BaseMessageBody> callback) {
        NukeApi.follow(MyApplication.getClient(), new FollowParam(FollowType.UNFOLLOW_USER, userId)).async(new RequestCallback<>(callback));
    }

    /**
     * 查询关注列表
     *
     * @param page     页数
     * @param callback 回调
     */
    public void followGet(int page, Callback<FollowUserListBody> callback) {
        NukeApi.followGet(MyApplication.getClient(), page).async(new RequestCallback<>(callback));
    }

    /**
     * 查询关注动态
     *
     * @param page     页数
     * @param callback 回调
     */
    public void followStatus(int page, Callback<FollowStatusBody> callback) {
        NukeApi.followStatus(MyApplication.getClient(), page).async(new RequestCallback<>(callback));
    }
}
